package com.wl.service.impl;

import java.util.List;

import javax.annotation.Resource;

import org.springframework.stereotype.Service;

import com.wl.dao.KnowledgeDao;
import com.wl.pojo.Knowledge;
import com.wl.service.KnowledgeService;

@Service("knowledgeService")
public class KnowledgeServiceImpl implements KnowledgeService {

	@Resource
	private KnowledgeDao knowledgeDao;

	@Override // 查找所有
	public List<Knowledge> getKnowledgeAll() {
		return knowledgeDao.selectKnowledgeAll();
	}

	@Override // 根据id查找
	public Knowledge getKnowledgeById(int klId) {
		return knowledgeDao.selectKnowledgeById(klId);
	}

	@Override // 根据标题模糊查找
	public List<Knowledge> getKnowledgeByTitle(String klTitle) {
		return knowledgeDao.selectKnowledgeByTitle(klTitle);
	}

	@Override // 添加
	public int addKnowledge(Knowledge kl) {
		return knowledgeDao.insertKnowledge(kl);
	}

	@Override // 修改
	public int alterKnowledge(Knowledge kl) {
		return knowledgeDao.updateKnowledge(kl);
	}

	@Override // 根据id删除
	public int removeKnowledge(int klId) {
		return knowledgeDao.deleteKnowledge(klId);
	}

}
